home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------------------
- //
- // This code is copyright 2001 by G5 Software.
- // Any unauthorized usage, either in part or in whole of this code
- // is strictly prohibited. Violators WILL be prosecuted to the
- // maximum extent allowed by law.
- //
- //-------------------------------------------------------------------
-
- //
- // *** mission AI controller ***
- //
-
- class CBaseAIController
- {
- //
- // *** virtual functions
- //
- // overwrite the following 2 functions to receive the entrance of objects to nav points
-
- // called when object entered active area
- void OnObjectEnterArea( int _NavPointIndex, string _NavPointName, string _ObjectID)
- {
- Core_LogMessage("GameObject <" + _ObjectID + "> entered activate area [" + _NavPointName + "]");
- };
-
- // called whenobject leaved active area
- void OnObjectLeaveArea( int _NavPointIndex, string _NavPointName, string _ObjectID)
- {
- Core_LogMessage("GameObject <" + _ObjectID + "> left activate area [" + _NavPointName + "]");
- };
-
- // called on initialization
- void Init( int _GameTime) {};
-
- // called every synchronization takt
- void Update( int _GameTime) {};
-
-
- // *** Data & Functionality
-
- array ActivatePointCenterList = array();
- array ActivatePointRadiusList = array();
- array ActivatePointNameList = array();
-
- void OnAddNavPoint( string _NavPointName, matrix _NavPointMatrix, float _Radius)
- {
- // insert point to lists
- ActivatePointCenterList.addElement( Core_GetMatrixOrigin( _NavPointMatrix));
- ActivatePointRadiusList.addElement( _Radius);
- ActivatePointNameList.addElement( _NavPointName);
-
- // reload controller
- LoadActivatePoints();
- }
-
- vector GetNavPointByIndex( int _Index)
- {
- return ActivatePointCenterList[_Index];
- }
-
- vector GetNavPointByName( string _Name)
- {
- for ( int i = 0; i < ActivatePointCenterList.size(); i = i + 1)
- {
- if ( ActivatePointNameList[i] == _Name)
- {
- return ActivatePointCenterList[i];
- };
- };
- }
-
- float GetNavPointRadiusByIndex( int _Index)
- {
- return ActivatePointRadiusList[_Index];
- }
-
- float GetNavPointRadiusByName( string _Name)
- {
- for ( int i = 0; i < ActivatePointCenterList.size(); i = i + 1)
- {
- if ( ActivatePointNameList[i] == _Name)
- {
- return ActivatePointRadiusList[i];
- };
- };
- }
-
- }
-